package cn.com.twoke.application.game.mario.core.ecs.component.render.group;


import cn.com.twoke.application.game.mario.core.ecs.component.render.RenderComponent;
import cn.com.twoke.application.game.mario.core.ecs.component.render.RenderHandler;
import lombok.Builder;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
@Builder(toBuilder = true)
@RenderHandler(GroupRenderComponentHandler.class)
public class GroupRenderComponent implements RenderComponent {

    @Builder.Default
    private List<RenderComponent> components = new ArrayList<>();

    public GroupRenderComponent add(RenderComponent component) {
        components.add(component);
        return this;
    }

    @Override
    public Integer getIndex() {
        return 0;
    }

    @Override
    public Boolean isDisplay() {
        return Boolean.TRUE;
    }
}
